<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SHOP 管理中心 - 属性管理 </title>
<base href="__STATIC__/Admin/">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/general.css" rel="stylesheet" type="text/css" />
<link href="styles/main.css" rel="stylesheet" type="text/css" />
</head>
<body>

<h1>
<!-- <span class="action-span"><a href="{:url('Admin/GoodsType/GoodsType_list')}">商品类型</a></span> -->
<span class="action-span"><a href="{:url('Admin/Attribute/attr_add')}">添加属性</a></span>
<span class="action-span1"><a href="index.php?act=main">SHOP 管理中心</a> </span><span id="search_id" class="action-span1"> - 商品属性 </span>
<div style="clear:both"></div>
</h1>

<div class="form-div">
  <form method="post" action="{:url('Admin/Attribute/attr_list')}">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH">
    按商品类型显示：
    <select name="type_id">
      <option value="0">所有商品类型</option>
      {foreach $type as $v}
         <option value="{$v.type_id}">{$v.type_name}</option>
      {/foreach}
    </select>
    <input type="submit" value=" 确定 " style="height: 18px;">
  </form>
</div>

<div class="list-div" id="listDiv">

  <table cellpadding="3" cellspacing="1">
    
  		<tr>
  			<th><input type="checkbox">编号 </th>
  			<th>属性名称</th>
  			<th>商品类型</th>
  			<th>属性值的录入方式</th>
  			<th>可选值列表</th>
  			<th>操作</th>
  		</tr>
      <tbody id="list">
      {foreach $list as $v}
      <tr>
  			<td nowrap="true" valign="top" align="center"><span><input name="checkboxes[]" type="checkbox">{$v.attr_id}</span></td>
  			<td class="first-cell" nowrap="true" valign="top" align="center">{$v.attr_name}</td>
  			<td nowrap="true" valign="top" align="center" value='{$v.type_id}'>{$v.type_name}</td>
  			<td nowrap="true" valign="top" align="center"><span>
        {if condition="($v['attr_input_type'] == 0)"}
            手动输入
          {elseif condition="($v['attr_input_type'] == 1)"/}
            从列表中选择
        {/if}
        </span></td>
  			<td valign="top" align="center"><span>{$v.attr_values}</span></td>
  			<td align="center" nowrap="true" valign="top">
  				<a href="javascript:;" title="移除" class="sc" id="{$v.attr_id}"><img src="images/icon_drop.gif" border="0" height="16" width="16"></a>
  			</td>
  		</tr> 
     {/foreach}  
      </tbody>
    </table>


</div>
  <div>{$list->render()}</div>

<div id="footer">
	版权所有 &copy; 2006-2013 软工教育 - 高级PHP - </div>
</div>

</body>
<script src="jquery.js"></script>
<script>
      $(".sc").on('click',function(){
          var id = $(this).attr('id');
          $.ajax({
              url:"{:url('Admin/Attribute/attr_del')}",
              type:"get",
              data:{id:id},
              dataType:'json',
              success:function(e){
                if(e.code==1){
                    alert(e.msg);
                    history.go(0)
                }else if(e.code==0){
                    alert(e.msg);
                    history.go(0)
                }
              }
          });
      });

</script>
</html>